import {
	defineConfig
} from "vite"
import uni from "@dcloudio/vite-plugin-uni"
import AutoImport from 'unplugin-auto-import/vite'

export default defineConfig({
	plugins: [
		// 加上下面的配置
		AutoImport({
			include: [
				/\.[tj]sx?$/, // .ts, .tsx, .js, .jsx
				/\.vue$/,
				/\.vue\?vue/, // .vue
			],
			imports: [
				'vue',
				'uni-app','pinia',
				{
					"/common/api.js": [
						["default", "$api"]
					],
					"/utils/utils.js": [
						["default", "$use"]
					]

				},
			],
			dts: 'typings/auto-imports.d.ts',
		}),
		uni() // 自动导入在微信小程里需要将其他导入放在 uni() 之前, 否则自动导入不生效
	],
})